package com.powerbank.common.event.payment;

import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 支付成功事件
 */
@Data
public class PaymentSuccessEvent {

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 支付ID
     */
    private String paymentId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 支付金额
     */
    private BigDecimal amount;

    /**
     * 支付方式
     */
    private String paymentMethod;

    /**
     * 创建时间
     */
    private LocalDateTime createdTime;

    public PaymentSuccessEvent() {
        this.createdTime = LocalDateTime.now();
    }

    public PaymentSuccessEvent(Long orderId, String paymentId, Long userId, BigDecimal amount, String paymentMethod) {
        this.orderId = orderId;
        this.paymentId = paymentId;
        this.userId = userId;
        this.amount = amount;
        this.paymentMethod = paymentMethod;
        this.createdTime = LocalDateTime.now();
    }
}